<template>
  <el-card style="margin: 250px auto 0;max-width: 500px;">
    <el-form :model="form" label-width="auto">
      <el-form-item label="用户名">
        <el-input v-model="form.username" />
      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="form.password" type="password" show-password />
      </el-form-item>
      <el-form-item label=" ">
        <el-checkbox v-model="form.checked" label="记住密码" />
      </el-form-item>
      <el-form-item label=" ">
        <el-button type="primary" @click="onSubmit">登录</el-button>
        <el-button>清空</el-button>
      </el-form-item>
      
      
    </el-form>
  </el-card>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'

// do not use same name with ref
const form = reactive({
  username: '',
  password: '',
  checked: true
})

const onSubmit = () => {
  console.log('submit!')
  console.log(form);
  
}
</script>